Skip to content

Enable correct exporting of char data but with passing CI#99

Merged
bkueng merged 2 commits intoPX4:mainfrom
hermankolden:pr_fix_char_type_export
Jul 4, 2024
Merged

Enable correct exporting of char data but with passing CI#99
bkueng merged 2 commits intoPX4:mainfrom
hermankolden:pr_fix_char_type_export

Conversation

@hermankolden
Copy link
Copy Markdown
Contributor

Same as #95 but with fixed CI since it seems the original author might not fix it

junwoo091400 and others added 2 commits April 17, 2024 15:04
As the data type for saving the char in pyulog was np.int8, the topics
that had fields with characters weren't able to get encoded (with error:
pyulog struct.error: char format requires a bytes object of length 1).

Therefore, this enables manual conversion of np.int8 object into bytes()
with single character, so that struct.pack command works as expected.

Notable example of where this is needed is the "transponder_report"
topic (included in PX4 v1.14)'s callsign[] character array. Before this
fix, the "write_ulog()" function would fail as the struct.pack couldn't
correctly encode the characters stored in int8 type
@bkueng bkueng merged commit d23cb8f into PX4:main Jul 4, 2024
@hermankolden hermankolden deleted the pr_fix_char_type_export branch July 4, 2024 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants